//Animate.cpp

#include "Animate.h"

//aniation fo shapes moving across the screen sides
void Animate::animateAcrossScr(ShapeCont& shapeCont, bool isFullFill)
{
	clrscr();
	while (!_kbhit())	//while no key was pressed
	{
		shapeCont.execShifts();
		shapeCont.drawAllToBuffer('*', isFullFill, true, m_scr);
		m_scr.printDiff();
		m_scr.swapPointersAndInitNewBuff();
		Sleep(100);	//sleep for 10 ms = 1/10 sec
	}
	shapeCont.resetMovementParms();
}

//aniation fo shapes moving with collisions
void Animate::animateCollisions(ShapeCont& shapeCont, bool isFullFill)
{
	clrscr();
	while (!_kbhit())	//while no key was pressed
	{
		shapeCont.execShiftsWithColiisions();
		shapeCont.drawAllToBuffer('*', isFullFill, true, m_scr);
		m_scr.printDiff();
		m_scr.swapPointersAndInitNewBuff();
		Sleep(100);	//sleep for 10 ms = 1/10 sec
	}
	shapeCont.resetMovementParms();
}